//
//  DeviceItemTableViewCell.m
//  sentorise
//
//  Created by admin on 2025/8/25.
//

#import "DeviceItemTableViewCell.h"
#import "GlobalDefine.h"

@implementation DeviceItemTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setIsOnline:(BOOL)isOnline {
    _isOnline = isOnline;
    UIImage *image = [UIImage imageNamed: isOnline ? @"device_item_s" : @"device_item_n"];
    UIEdgeInsets insets = UIEdgeInsetsMake(30, 50, 20, 200);
    UIImage *stretchedImage = [image resizableImageWithCapInsets:insets resizingMode:UIImageResizingModeStretch];
    self.bgIV.image = stretchedImage;
    // 保证拉伸效果生效
    self.bgIV.contentMode = UIViewContentModeScaleToFill;
}

@end
